package com.chamberlain.equipment.service.impl;

import com.chamberlain.equipment.domain.Electric;
import com.chamberlain.equipment.mapper.ElectricMapper;
import com.chamberlain.equipment.service.IElectricService;
import com.chamberlain.equipment.service.IEquipmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author: CYY
 * @date: 2024/3/25
 */
@Service
public class ElectricServiceImpl implements IElectricService {
    @Resource
    private ElectricMapper electricMapper;

    /**
     * 查询电能设备
     *
     * @param id 电能设备主键
     * @return 电能设备
     */
    @Override
    public Electric selectElectricById(Integer id)
    {
        return electricMapper.selectElectricById(id);
    }

    /**
     * 查询电能设备列表
     *
     * @param electric 电能设备
     * @return 电能设备
     */
    @Override
    public List<Electric> selectElectricList(Electric electric)
    {
        return electricMapper.selectElectricList(electric);
    }

    /**
     * 新增电能设备
     *
     * @param electric 电能设备
     * @return 结果
     */
    @Override
    public int insertElectric(Electric electric)
    {
        return electricMapper.insertElectric(electric);
    }

    /**
     * 修改电能设备
     *
     * @param electric 电能设备
     * @return 结果
     */
    @Override
    public int updateElectric(Electric electric)
    {
        return electricMapper.updateElectric(electric);
    }

    /**
     * 批量删除电能设备
     *
     * @param ids 需要删除的电能设备主键
     * @return 结果
     */
    @Override
    public int deleteElectricByIds(Integer[] ids)
    {
        return electricMapper.deleteElectricByIds(ids);
    }

    /**
     * 删除电能设备信息
     *
     * @param id 电能设备主键
     * @return 结果
     */
    @Override
    public int deleteElectricById(Integer id)
    {
        return electricMapper.deleteElectricById(id);
    }
}
